﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.Models;
//using Pibby.Core.Presenters;
//using Pibby.Core.ViewModels;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class PodcastPropertiesPresenterTests : IntegrationBaseTestFixture
//    {
//        private Stubs.PodcastPropertiesView _view;
//        private Stubs.PodcastPropertiesModel _model;
//        private PodcastPropertiesPresenter _presenter;

//        [TestInitialize]
//        public override void Setup()
//        {
//            base.Setup();

//            this._view = new Stubs.PodcastPropertiesView();
//            this._model = new Stubs.PodcastPropertiesModel();

//            PodcastPropertiesViewModel vm = new PodcastPropertiesViewModel("My Terrific Podcast",
//                                                                            new Uri("http://myterrificpodcast.com"),
//                                                                            DateTime.Today.AddMonths(-12),
//                                                                            "I think this is terrific, and you will too!");
//            this._model.Properties = vm;

//            this._presenter = new PodcastPropertiesPresenter(this._view, this._model);
//        }

//        [TestCleanup]
//        public override void TearDown()
//        {
//            base.TearDown();

//            this._presenter.UnsubscribeToClientEvents();
//        }

//        [TestMethod]
//        public void AtStartup_NullPodcast_ViewInitialisedCorrectly()
//        {
//            this._view.SimulateLoadEvent();

//            Assert.IsTrue(this._view.ShowInfoCalled);
//        }

//        [TestMethod]
//        public void AtStartup_ExistingPodcast_ViewInitialisedCorrectly()
//        {
//            this._view.SimulateLoadEvent();

//            Assert.IsTrue(this._view.ShowInfoCalled);

//            Assert.AreEqual(this._model.Properties.Name, this._view.Properties.Name);
//            Assert.AreEqual(this._model.Properties.Url, this._view.Properties.Url);
//            Assert.AreEqual(this._model.Properties.PublicationDate, this._view.Properties.PublicationDate);
//            Assert.AreEqual(this._model.Properties.Description, this._view.Properties.Description);
//        }

//        [TestMethod]
//        public void ChangingName_ExistingPodcast_SavedToModel()
//        {
//            this._view.SimulateLoadEvent();

//            this._view.Properties.Name = "Completely different Name";

//            this._view.SimulateAcceptChanges(this._view.Properties.Url.AbsoluteUri, this._view.Properties.Name);

//            Assert.AreEqual(this._model.Properties.Name, this._view.Properties.Name);
//            Assert.AreEqual(this._model.Properties.Url, this._view.Properties.Url);
//            Assert.AreEqual(this._model.Properties.PublicationDate, this._view.Properties.PublicationDate);
//            Assert.AreEqual(this._model.Properties.Description, this._view.Properties.Description);
//        }

//        [TestMethod]
//        public void ChangingUrl_ExistingPodcast_SavedToModel()
//        {
//            this._view.SimulateLoadEvent();

//            this._view.Properties.Url = new Uri("http://completelydifferent.com/feed.xml");

//            this._view.SimulateAcceptChanges(this._view.Properties.Url.AbsoluteUri, this._view.Properties.Name);

//            Assert.AreEqual(this._model.Properties.Name, this._view.Properties.Name);
//            Assert.AreEqual(this._model.Properties.Url, this._view.Properties.Url);
//            Assert.AreEqual(this._model.Properties.PublicationDate, this._view.Properties.PublicationDate);
//            Assert.AreEqual(this._model.Properties.Description, this._view.Properties.Description);
//        }

//        [TestMethod]
//        public void ChangingUrl_ExistingPodcast_DiscardCancelsChanges()
//        {
//            this._view.SimulateLoadEvent();

//            this._view.Properties.Url = new Uri("http://completelydifferent.com/feed.xml");

//            this._view.SimulateDiscardChanges ();

//            Assert.AreEqual(this._model.Properties.Name, this._view.Properties.Name);
//            Assert.AreEqual(this._model.Properties.Url, this._view.Properties.Url);
//            Assert.AreEqual(this._model.Properties.PublicationDate, this._view.Properties.PublicationDate);
//            Assert.AreEqual(this._model.Properties.Description, this._view.Properties.Description);
//        }

//    }
//}
